﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;

namespace WebApplication.Admins
{
    public partial class SearchLoaiSP : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string SearchString = Request.QueryString["Search"] ?? "";
            if (SearchString != "")
                lblDes.Text = "Bạn muốn tìm thông tin \"" + SearchString + "\"";
            Display();
        }
        public void Display()
        {
            string searchString = Request.QueryString["Search"] ?? "";
            if (searchString != "")
            {
                List<Entities.LoaiSP> data = LoaiSPBLL.TimKiemLoaiSP(searchString);
                if (data.Count > 0)
                {
                    repChuDe.DataSource = data;
                    repChuDe.DataBind();
                }
                else
                {
                    Response.Redirect("~/Admins/LoaiSP.aspx");
                }
            }
        }
    }
}